package com.company;

public class HourlyEmployee extends Employee{
    private int hourSalary; // 每小时工资
    private int hours; // 每月工作的小时数

    public int getHourSalary() {
        return hourSalary;
    }

    public void setHourSalary(int hourSalary) {
        this.hourSalary = hourSalary;
    }

    public int getHours() {
        return hours;
    }

    public void setHours(int hours) {
        this.hours = hours;
    }

    @Override
    public int getSalary(int month) {
        int salary = 0; // 月工资
        if (this.hours <= 160){
            salary = this.hours * this.hourSalary;
        }else{
            salary = (int) (this.hours * this.hourSalary * 1.5);
        }
        return salary + super.getSalary(month);
    }
}
